// 该文件专门用于创建整个应用的路由器
import VueRouter from "vue-router";
//引入模块
// 登录
import login from '@/pages/login'
// 首页
import index from '@/pages/index';
import mainAdmin from "@/pages/system/mainAdmin";

//借贷管理
//利率管理
import rate from "../system/rate";
//借贷信息
import legal from "../system/legal";

//资料认证管理
//借贷审批
import company from "../system/company";
import companyCertification from "../system/companyCertification";

//还款管理
//还款详情
import information from '../system/information'

//用户管理
//用户信息
import user from "../system/user";

//系统管理
//管理员
import admin from "../system/admin";






const routes = [
    {
        path: '/',
        name: 'login',
        component:login,
        hidden: true,
        meta: {
            requireAuth: false //登录权限实现(登录拦截)
        }
    },
    {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children:[
            {
                path: '/index/mainAdmin',
                name: '欢迎页',
                component: mainAdmin,
            },
            {
                path: '/rate',
                name: '利率管理',
                component: rate,
            },
            {
                path: '/legal',
                name: '借贷信息',
                component: legal,
            },


            {
                path: '/company',
                name: '借贷审批',
                component: company,
            },
            {
                path: '/companyCertification',
                name: '借贷审批',
                component: companyCertification,
            },

            {
                path: '/information',
                name: '还款详情',
                component: information,
            },


            {
                path: '/user',
                name: '用户信息',
                component: user,
            },

            {
                path: '/admin',
                name: '管理员',
                component: admin,
            },
        ]

    },

]

//创建并暴露一个路由器
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
